import alg
import gen
import random

def test_can_place_flowers(num_tests=5):
    for i in range(num_tests):
        length = random.randint(5, 10)  # 随机选择花坛长度在 5 到 10 之间
        flowerbed = gen.generate_flowerbed(length)
        n = gen.generate_n(3)  # 随机选择要种植的花朵数量，假设最大为 3
        
        result = alg.can_place_flowers(flowerbed, n)
        
        print(f"测试案例 {i + 1}:")
        print("花坛情况:", flowerbed)
        print("要种植的花朵数量:", n)
        print("结果:", result)
        print("-" * 30)

if __name__ == "__main__":
    test_can_place_flowers()  # 执行测试